﻿@model ThaireInvestmentWeb.Models.EditUnitTrustPrivilegeModel
@{
    ViewBag.Title = "Edit UnitTrustPrivilege";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<script>
    $(document).ready(function () {

        $("#EXDate,#Privilege_BcdDate,#Privilege_PaymentDate,#Privilege_TrannsaferDate").datepicker(
        {
            dateFormat: 'dd/mm/yy',
            yearRange: "-30:+40",
            showOn: 'button',
            showAnim: 'fadeIn',
            changeMonth: true,
            changeYear: true,
            showButtonPanel: true,
            buttonImage: '@Url.Content("~/Content/images/Calendar.png")'
        });
        $("#CancelBtn").click(function (event) {
            showConfirm(null, CancelBtnAction);
            return false;
        });

    });

    function CancelBtnAction(event) {
        window.location.href = 'ManageUnitTrustPrivilege?headerId=@Model.HeaderID';
    }

</script>


<table class="navi" width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
        <td style="width: 100%;">
            <div class="navi">
                Instrument Type > <a href="@Url.Action("ManageUnitTrust", "UnitTrust", new { headerId = @Model.HeaderID })">Unit Trust</a> > <a href="@Url.Action("EditUnitTrustHeader", "UnitTrust", new { headerId = @Model.HeaderID })">Header</a> > <a href="@Url.Action("ManageUnitTrustPrivilege", "UnitTrust", new { headerId = @Model.HeaderID })">ข้อมูลสิทธิประโยชน์ </a>>Detail
            </div>
        </td>
    </tr>
</table>
<table align="center" border="0" cellpadding="0" cellspacing="0" class="tableheader" width="100%">
    <tr>
        <td height="38" tyle="width: 100%; text-align: center;">Unit Trust : Detail ข้อมูลสิทธิประโยชน์</td>
    </tr>
</table>
<table style="width: 100%; text-align: center;">
    <tr>
        <td>
            @Html.Partial("_UnitTrustHeaderView", Model.ScreenData.HeaderDTO)
            @Html.ValidationSummary(true)
            @using (Html.BeginForm("EditUnitTrustPrivilege", "UnitTrust", FormMethod.Post, new { id = "mainForm" }))
            {
                <table style="margin-top: 20px;" class="tableform" width="100%" border="5" align="center" cellspacing="2">
                    <tr>
                        <td style="height: 4px; width: 161px;">&nbsp;</td>
                        <td style="height: 4px"></td>
                        <td style="width: 236px; height: 4px;"></td>
                        <td style="height: 4px"></td>
                        <td style="height: 4px"></td>
                        <td style="height: 4px"></td>
                    </tr>
                    <tr>
                        <td style="width: 161px">
                            <div align="right">จำนวนที่ถือครอง Unit : </div>
                        </td>
                        <td>&nbsp;</td>
                        <td style="width: 236px">
                            @Html.TextBoxFor(model => model.Header.RemainUnit, new { @readonly = "readonly" })</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                    </tr>
                    <tr>
                        <td style="width: 161px">
                            <div align="right">Type : </div>
                        </td>
                        <td>&nbsp;</td>
                        <td style="width: 236px">
                            @Html.DropDownListFor(x => x.SelectedType, Model.TypeList)
                            @Html.ValidationMessageFor(model => model.SelectedType)
                        </td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                    </tr>
                    <tr>
                        <td style="width: 161px">
                            <div align="right">Ex Date  <span class="error">* </span>: </div>
                        </td>
                        <td>&nbsp;</td>
                        <td style="width: 236px">
                        @Html.TextBoxFor(model => model.EXDate, new {  style = "width: 80px;", @Value = ThaireInvestmentWeb.Util.WebUtil.FormatDate(@Model.EXDate) })
                        @Html.ValidationMessageFor(model => model.EXDate)   (Ex.31/12/2014)
                        <td>
                            <div align="right">Book Closing Date (BCD): </div>
                        </td>
                        <td>&nbsp;</td>
                        <td>
                            @Html.TextBoxFor(model => model.Privilege.BcdDate, new { style = "width: 80px;", @Value = ThaireInvestmentWeb.Util.WebUtil.FormatDate(@Model.Privilege.BcdDate) })
                            @Html.ValidationMessageFor(model => model.Privilege.BcdDate)  (Ex.31/12/2014)

                        </td>
                    </tr>
                    <tr>
                        <td style="width: 161px; text-align: right;">Type of Payment : </td>
                        <td>&nbsp;</td>
                        <td style="width: 236px">
                            @Html.DropDownListFor(x => x.SelectedTypeOfPayment, Model.TypeOfPaymentList)
                            @Html.ValidationMessageFor(model => model.SelectedTypeOfPayment)
                        </td>
                        <td>
                            <div align="right">Payment Date : </div>
                        </td>
                        <td>&nbsp;</td>
                        <td>
                            @Html.TextBoxFor(model => model.Privilege.PaymentDate, new { style = "width: 80px;", @Value = ThaireInvestmentWeb.Util.WebUtil.FormatDate(@Model.Privilege.PaymentDate) })   (Ex.31/12/2014)
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 161px">
                            <div align="right">DIV./UNIT : </div>
                        </td>
                        <td>&nbsp;</td>
                        <td style="width: 236px">
                            @Html.TextBoxFor(model => model.Privilege.DivUnit, new { @class = "inputNumberField", @Value = ThaireInvestmentWeb.Util.WebUtil.FormatCurrency0(@Model.Privilege.DivUnit) })
                            @*@Html.TextBoxFor(model => model.Privilege.DivUnit)*@
                            @Html.ValidationMessageFor(model => model.Privilege.DivUnit)
                        </td>
                        <td style="width: 161px">
                            <div align="right">DIV. (AMOUNT) : </div>
                        </td>
                        <td>&nbsp;</td>
                        <td style="width: 236px">
                            @Html.TextBoxFor(model => model.Privilege.DivAmount, new { @readonly = "readonly" })
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 161px; background-color: #D7EBFF;">
                            <div align="right">DIV. - Stock :</div>
                        </td>
                        <td style="background-color: #D7EBFF">&nbsp;</td>
                        <td style="width: 236px; background-color: #D7EBFF;">
                            @Html.TextBoxFor(model => model.Privilege.DivStock, new { @class = "inputNumberField", @Value = ThaireInvestmentWeb.Util.WebUtil.FormatCurrency0(@Model.Privilege.DivStock) })
                            @*@Html.TextBoxFor(model => model.Privilege.DivStock)*@
                            @Html.ValidationMessageFor(model => model.Privilege.DivStock)
                        </td>
                        <td style="background-color: #D7EBFF">&nbsp;</td>
                        <td style="background-color: #D7EBFF">&nbsp;</td>
                        <td style="background-color: #D7EBFF">&nbsp;</td>
                    </tr>
                    <tr>
                        <td style="width: 161px; text-align: right; background-color: #D7EBFF;">UNIT (เศษหุ้น) :</td>
                        <td style="background-color: #D7EBFF">&nbsp;</td>
                        <td style="width: 236px; background-color: #D7EBFF;">
                            @Html.TextBoxFor(model => model.Privilege.FractionUnit, new { @class = "inputNumberField", @Value = ThaireInvestmentWeb.Util.WebUtil.FormatCurrency0(@Model.Privilege.FractionUnit) })
                            @*@Html.TextBoxFor(model => model.Privilege.FractionUnit)*@
                            @Html.ValidationMessageFor(model => model.Privilege.FractionUnit)
                        </td>
                        <td style="width: 161px; background-color: #D7EBFF;">
                            <div align="right">
                                DIV./UNIT (เศษหุ้น) :
                            </div>
                        </td>
                        <td style="background-color: #D7EBFF">&nbsp;</td>
                        <td style="width: 236px; background-color: #D7EBFF;">
                            @Html.TextBoxFor(model => model.Privilege.FractionDivUnit, new { @class = "inputNumberField", @Value = ThaireInvestmentWeb.Util.WebUtil.FormatCurrency0(@Model.Privilege.FractionDivUnit) })
                            @*@Html.TextBoxFor(model => model.Privilege.FractionDivUnit)*@
                            @Html.ValidationMessageFor(model => model.Privilege.FractionDivUnit)
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 161px">
                            <div align="right">Right Old : New </div>
                        </td>
                        <td>&nbsp;</td>
                        <td style="width: 236px">
                            @Html.TextBoxFor(model => model.Privilege.RightOldNew, new { @class = "inputNumberField", @Value = ThaireInvestmentWeb.Util.WebUtil.FormatCurrency0(@Model.Privilege.RightOldNew) })
                            @*@Html.TextBoxFor(model => model.Privilege.RightOldNew)*@
                            @Html.ValidationMessageFor(model => model.Privilege.RightOldNew)
                        </td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                    </tr>
                    <tr>
                        <td style="width: 161px">
                            <div align="right">Amortize / Unit : </div>
                        </td>
                        <td>&nbsp;</td>
                        <td style="width: 236px">
                            @Html.TextBoxFor(model => model.Privilege.AmortizeUnit, new { @class = "inputNumberField", @Value = ThaireInvestmentWeb.Util.WebUtil.FormatCurrency0(@Model.Privilege.AmortizeUnit) })
                            @*@Html.TextBoxFor(model => model.Privilege.AmortizeUnit)*@
                            @Html.ValidationMessageFor(model => model.Privilege.AmortizeUnit)

                        </td>
                        <td>
                            <div align="right">ราคาต่อหุ้น: </div>
                        </td>
                        <td>&nbsp;</td>
                        <td>
                            @Html.TextBoxFor(model => model.Privilege.PriceUnit, new { @class = "inputNumberField", @Value = ThaireInvestmentWeb.Util.WebUtil.FormatDecimal2Digit(@Model.Privilege.PriceUnit) })
                            @*@Html.TextBoxFor(model => model.Privilege.PriceUnit)*@
                            @Html.ValidationMessageFor(model => model.Privilege.PriceUnit)

                        </td>
                    </tr>
                    <tr>
                        <td>
                            <div align="right">วันที่แปลงหุ้น : </div>
                        </td>
                        <td>&nbsp;</td>
                        <td>
                            @Html.TextBoxFor(model => model.Privilege.TrannsaferDate, new {  style = "width: 80px;",@Value = ThaireInvestmentWeb.Util.WebUtil.FormatDate(@Model.Privilege.TrannsaferDate) })    (Ex.31/12/2014)
                        </td>
                        <td>
                            <div align="right">ราคาแปลงหุ้น : </div>
                        </td>
                        <td>&nbsp;</td>
                        <td>
                            @Html.TextBoxFor(model => model.Privilege.TrannsaferPrice, new { @class = "inputNumberField", @Value = ThaireInvestmentWeb.Util.WebUtil.FormatDecimal2Digit(@Model.Privilege.TrannsaferPrice) })
                            @*@Html.TextBoxFor(model => model.Privilege.TrannsaferPrice)*@
                            @Html.ValidationMessageFor(model => model.Privilege.TrannsaferPrice)
                        </td>
                    </tr>
                    <tr>
                        <td style="height: 4px; width: 161px;">&nbsp;</td>
                        <td style="height: 4px"></td>
                        <td style="width: 236px; height: 4px;"></td>
                        <td style="height: 4px"></td>
                        <td style="height: 4px"></td>
                        <td style="height: 4px"></td>
                    </tr>
                </table>
                
                <table width="95%" height="85" border="0" align="center">
                    <tr>
                        <td>
                            <div align="center">

                                <input id="SubmitBtn" type="submit" name="SubmitBtn" value=" Submit " need-confirm="true" class="button">
                                &nbsp;&nbsp; 
                                <input id="CancelBtn" type="button" name="CancelBtn" value=" Cancel " class="button">
                            </div>
                        </td>
                    </tr>

                </table>
    
                @Html.HiddenFor(x => x.UpdateMode);
                @Html.HiddenFor(x => x.HeaderID);
                @Html.HiddenFor(x => x.PrivilegeID);
            }

        </td>
    </tr>
</table>



